//
//  KeyEvent.swift
//  HisPaste
//
//  Created by 烟雀 on 2024/2/16.
//

import Foundation
import KeyboardShortcuts

extension KeyboardShortcuts.Name{
    static let cmdJ = Self("Command+J")
}

extension AppHelper{
    static func addKeyEvent(event_: @escaping () -> Void){
        
        let _cmdJ = KeyboardShortcuts.Shortcut(.j, modifiers: [.command])
        KeyboardShortcuts.setShortcut(_cmdJ, for: .cmdJ)
        KeyboardShortcuts.onKeyDown(for: .cmdJ, action: {
            event_()
        })
    }
}
